package cn.com.xf.web.form;

import java.util.Date;

import org.hibernate.validator.constraints.NotEmpty;

import cn.com.xf.domain.TblCheckMend;
import cn.com.xf.utils.DateUtils;

public class MendForm extends BaseForm {

	private String id;
	private String userid;
	private String siteid;
	private String checkdate;
	private String reason;
	private String adduser;
	private String deptid;
	private String type;
	private String time1;
	private String time2;
	private String time3;
	private String year_month;
	private String mendJson;
	private String sitename;
	//------请假excel导出
	private String mendFileName;
	
	
	private Integer deptflag;
    private Integer personflag;
    private String deptremark;
    private String  personremark;
    private Integer flag;
    private String deptuser;
    private String personuser;
    private String remark;

	public Integer getDeptflag() {
		return deptflag;
	}

	public void setDeptflag(Integer deptflag) {
		this.deptflag = deptflag;
	}

	public Integer getPersonflag() {
		return personflag;
	}

	public void setPersonflag(Integer personflag) {
		this.personflag = personflag;
	}

	public String getDeptremark() {
		return deptremark;
	}

	public void setDeptremark(String deptremark) {
		this.deptremark = deptremark;
	}

	public String getPersonremark() {
		return personremark;
	}

	public void setPersonremark(String personremark) {
		this.personremark = personremark;
	}

	public Integer getFlag() {
		return flag;
	}

	public void setFlag(Integer flag) {
		this.flag = flag;
	}

	public String getDeptuser() {
		return deptuser;
	}

	public void setDeptuser(String deptuser) {
		this.deptuser = deptuser;
	}

	public String getPersonuser() {
		return personuser;
	}

	public void setPersonuser(String personuser) {
		this.personuser = personuser;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getSiteid() {
		return siteid;
	}

	public void setSiteid(String siteid) {
		this.siteid = siteid;
	}

	public String getCheckdate() {
		return checkdate;
	}

	public void setCheckdate(String checkdate) {
		this.checkdate = checkdate;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getAdduser() {
		return adduser;
	}

	public void setAdduser(String adduser) {
		this.adduser = adduser;
	}

	public String getDeptid() {
		return deptid;
	}

	public void setDeptid(String deptid) {
		this.deptid = deptid;
	}

	public String getTime1() {
		return time1;
	}

	public void setTime1(String time1) {
		this.time1 = time1;
	}

	public String getTime2() {
		return time2;
	}

	public void setTime2(String time2) {
		this.time2 = time2;
	}

	public String getTime3() {
		return time3;
	}

	public void setTime3(String time3) {
		this.time3 = time3;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public TblCheckMend copyTo() throws Exception {
		TblCheckMend mend = new TblCheckMend();
		mend.setUserid(userid);
		mend.setSiteid(siteid);
		mend.setCheckdate(DateUtils.parseDate(checkdate));
		mend.setReason(reason);
		mend.setType(new Short(type));
		if (!time1.equals("")) {
			String datetime1 = checkdate + " " + time1;
			mend.setTime1(DateUtils.parseDatetime(datetime1));
		}
		if (!time2.equals("")) {
			String datetime2 = checkdate + " " + time2;
			mend.setTime2(DateUtils.parseDatetime(datetime2));
		}
		if (!time3.equals("")) {
			String datetime3 = checkdate + " " + time3;
			mend.setTime3(DateUtils.parseDatetime(datetime3));
		}
		mend.setPersonuser(personuser);
		mend.setAddtime(new Date());
		mend.setFlag(flag);
		mend.setDeptflag(deptflag);
		mend.setPersonflag(personflag);
		return mend;
	}

	public TblCheckMend copyTo(TblCheckMend mend) throws Exception {
		mend.setUserid(userid);
		mend.setSiteid(siteid);
		mend.setCheckdate(DateUtils.parseDate(checkdate));
		mend.setReason(reason);
		mend.setType(new Short(type));
		if (!time1.equals("")) {
			String datetime1 = checkdate + " " + time1;
			mend.setTime1(DateUtils.parseDatetime(datetime1));
		} else {
			mend.setTime1(null);
		}
		if (!time2.equals("")) {
			String datetime2 = checkdate + " " + time2;
			mend.setTime2(DateUtils.parseDatetime(datetime2));
		} else {
			mend.setTime2(null);
		}
		if (!time3.equals("")) {
			String datetime3 = checkdate + " " + time3;
			mend.setTime3(DateUtils.parseDatetime(datetime3));
		} else {
			mend.setTime3(null);
		}
		mend.setFlag(flag);
		mend.setDeptflag(deptflag);
		mend.setPersonflag(personflag);
		return mend;
	}

	public String getMendJson() {
		return mendJson;
	}

	public void setMendJson(String mendJson) {
		this.mendJson = mendJson;
	}

	public String getMendFileName() {
		return mendFileName;
	}

	public void setMendFileName(String mendFileName) {
		this.mendFileName = mendFileName;
	}

	public String getYear_month() {
		return year_month;
	}

	public void setYear_month(String year_month) {
		this.year_month = year_month;
	}

	public String getSitename() {
		return sitename;
	}

	public void setSitename(String sitename) {
		this.sitename = sitename;
	}

	
}
